package demo3.demo4;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.net.ServerSocket;
import java.net.Socket;

@Component
public class Server implements InitializingBean {
    private int port;
    ServerSocket serverSocket;
    @Value("${client.port}")
    public void SetServer(int port){
        this.port = port;
    }
    @Override
    public void afterPropertiesSet() throws Exception {
        ServerSocket serverSocket = new ServerSocket(port);
    }
}
